﻿<UserControl x:Class="Profit.Controls.AgentAttributesControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Resources="clr-namespace:Profit.Resources" 
             xmlns:local="clr-namespace:Profit.Controls" 
             mc:Ignorable="d" 
             d:DesignHeight="97" d:DesignWidth="295"
             HorizontalContentAlignment="Center"
             VerticalContentAlignment="Stretch" >
    <UserControl.Resources>
        
        <Style x:Key="labelStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="1,0" />
        </Style>

        <Style x:Key="RightLabelStyle" BasedOn="{StaticResource labelStyle}" TargetType="{x:Type TextBlock}">
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>

        <Style x:Key="LeftLabelStyle" BasedOn="{StaticResource labelStyle}" TargetType="{x:Type TextBlock}">
            <Setter Property="HorizontalAlignment" Value="Left"/>
        </Style>
        
        <Style x:Key="rectangleStyle" TargetType="{x:Type Rectangle}">
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="Effect" Value="{StaticResource DropShadowEffectLight}"/>
            <Setter Property="Margin" Value="1"/>
        </Style>
        <Style x:Key="RightRectangleStyle" BasedOn="{StaticResource rectangleStyle}" TargetType="{x:Type Rectangle}">
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
        <Style x:Key="LeftRectangleStyle" BasedOn="{StaticResource rectangleStyle}" TargetType="{x:Type Rectangle}">
            <Setter Property="HorizontalAlignment" Value="Left"/>
        </Style>
    </UserControl.Resources>
    
    <Grid Margin="5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="40"/>
            <ColumnDefinition Width="3"/>
            <ColumnDefinition Width="40"/>
            <ColumnDefinition Width="50"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <TextBlock Text="{x:Static Resources:Messages.label_tactics}" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource RightLabelStyle}"/>
        <TextBlock Text="{x:Static Resources:Messages.label_mechatronic}" Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2" Style="{StaticResource LeftLabelStyle}"/>

        <TextBlock Text="{x:Static Resources:Messages.label_Industry}" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="0" Style="{StaticResource RightLabelStyle}"/>
        <TextBlock Text="{x:Static Resources:Messages.label_research}" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="3" Style="{StaticResource LeftLabelStyle}"/>

        <TextBlock Text="{x:Static Resources:Messages.label_politics}" Grid.Row="4" Grid.ColumnSpan="2" Grid.Column="0" Style="{StaticResource RightLabelStyle}"/>
        <TextBlock Text="{x:Static Resources:Messages.label_economics}" Grid.Row="4" Grid.ColumnSpan="2" Grid.Column="3" Style="{StaticResource LeftLabelStyle}"/>

        <Rectangle Name="rectTactics"  Grid.Row="1" Grid.Column="1" Width="{Binding Agent.TacticsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Fill="#F1000C" Style="{StaticResource RightRectangleStyle}"/>
        <Rectangle Name="rectMecha" Grid.Row="1" Grid.Column="3" Width="{Binding Agent.MechatronicsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Fill="#F98E4F" Style="{StaticResource LeftRectangleStyle}"/>

        <Rectangle Name="rectIndustry" Grid.Row="3" Grid.Column="1" Width="{Binding Agent.IndustryLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Fill="#00AD95" Style="{StaticResource RightRectangleStyle}"/>
        <Rectangle Name="rectResearch" Grid.Row="3" Grid.Column="3" Width="{Binding Agent.ResearchLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Fill="#237ACC" Style="{StaticResource LeftRectangleStyle}"/>

        <Rectangle Name="rectPolitics" Grid.Row="5" Grid.Column="1" Width="{Binding Agent.PoliticsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Fill="#4CED00" Style="{StaticResource RightRectangleStyle}"/>
        <Rectangle Name="rectEco" Grid.Row="5" Grid.Column="3" Width="{Binding Agent.EconomicsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Fill="#03C035" Style="{StaticResource LeftRectangleStyle}"/>

        <TextBlock Name="lblTactics" Grid.Row="1" Grid.Column="0" Text="{Binding Agent.TacticsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}"  Style="{StaticResource RightLabelStyle}"/>
        <TextBlock Name="lblMecha" Grid.Row="1" Grid.Column="4" Text="{Binding Agent.MechatronicsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}"  Style="{StaticResource LeftLabelStyle}"/>

        <TextBlock Name="lblIndustry" Grid.Row="3" Grid.Column="0" Text="{Binding Agent.IndustryLevel, RelativeSource={RelativeSource AncestorType=UserControl}}"  Style="{StaticResource RightLabelStyle}"/>
        <TextBlock Name="lblResearch" Grid.Row="3" Grid.Column="4" Text="{Binding Agent.ResearchLevel, RelativeSource={RelativeSource AncestorType=UserControl}}" Style="{StaticResource LeftLabelStyle}"/>

        <TextBlock Name="lblPolitics" Grid.Row="5" Grid.Column="0" Text="{Binding Agent.PoliticsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}"  Style="{StaticResource RightLabelStyle}" />
        <TextBlock Name="lblEco" Grid.Row="5" Grid.Column="4" Text="{Binding Agent.EconomicsLevel, RelativeSource={RelativeSource AncestorType=UserControl}}"  Style="{StaticResource LeftLabelStyle}"/>

        <local:SliderEx Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Minimum="0" Maximum="35" Value="{Binding Agent.TacticsLevel, RelativeSource={RelativeSource AncestorType=UserControl},Mode=TwoWay}" Style="{StaticResource ExtensionLevelSliderStyle}" />
        <local:SliderEx Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Minimum="0" Maximum="35" Value="{Binding Agent.IndustryLevel, RelativeSource={RelativeSource AncestorType=UserControl},Mode=TwoWay}" Style="{StaticResource ExtensionLevelSliderStyle}" />
        <local:SliderEx Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" Minimum="0" Maximum="35" Value="{Binding Agent.PoliticsLevel, RelativeSource={RelativeSource AncestorType=UserControl},Mode=TwoWay}" Style="{StaticResource ExtensionLevelSliderStyle}" />

        <local:SliderEx Grid.Row="1" Grid.Column="4" HorizontalAlignment="Right" Minimum="0" Maximum="35" Value="{Binding Agent.MechatronicsLevel, RelativeSource={RelativeSource AncestorType=UserControl},Mode=TwoWay}" Style="{StaticResource ExtensionLevelSliderStyle}" />
        <local:SliderEx Grid.Row="3" Grid.Column="4" HorizontalAlignment="Right" Minimum="0" Maximum="35" Value="{Binding Agent.ResearchLevel, RelativeSource={RelativeSource AncestorType=UserControl},Mode=TwoWay}" Style="{StaticResource ExtensionLevelSliderStyle}" />
        <local:SliderEx Grid.Row="5" Grid.Column="4" HorizontalAlignment="Right" Minimum="0" Maximum="35" Value="{Binding Agent.EconomicsLevel, RelativeSource={RelativeSource AncestorType=UserControl},Mode=TwoWay}" Style="{StaticResource ExtensionLevelSliderStyle}" />

    </Grid>
</UserControl>
